﻿using Dto;
using Model;

namespace Dlpad.Services
{
    public interface IDictTypeService
    {
        /// <summary>
        /// 分页查询字典类型
        /// </summary>
        Task<PagedResultDto<DictTypeResponseDto>> GetDictTypesAsync(DictTypeQueryDto query);

        /// <summary>
        /// 根据ID获取字典类型
        /// </summary>
        Task<SysDictType?> GetDictTypeByIdAsync(long id);

        /// <summary>
        /// 创建字典类型
        /// </summary>
        Task<bool> CreateDictTypeAsync(SysDictType dictType);

        /// <summary>
        /// 更新字典类型
        /// </summary>
        Task<bool> UpdateDictTypeAsync(SysDictType dictType);

        /// <summary>
        /// 删除字典类型
        /// </summary>
        Task<bool> DeleteDictTypeAsync(long id);

        /// <summary>
        /// 检查字典类型是否唯一
        /// </summary>
        Task<bool> IsDictTypeUniqueAsync(string dictType, long? excludeId = null);

        /// <summary>
        /// 获取所有字典类型（适合缓存）
        /// </summary>
        Task<List<DictTypeResponseDto>> GetAllDictTypesAsync();

        /// <summary>
        /// 从数据库获取所有字典类型（供缓存服务调用）
        /// </summary>
        Task<List<DictTypeResponseDto>> GetAllDictTypesFromDbAsync();
    }
}